/*
Geoffrey Wallace	
Proposal title: "International Law and the Credibility of Commitments"


HYPOTHESES

Stated-Hyp1: "An increase in level of legalization of a commitment should be associated
with an increase in the expectations that a country will comply with its promise." (p. 4)

	Test-Hyp1: Expectation for compliance will be higher in any legalization scenario vs. no legalization

	Test-Hyp2: Expectation for compliance will be higher in hard law scenario vs. soft law
	
Stated-Hyp2: "Legalizing a commitment should have a greater effect on expectations of
compliance for countries with a history of violations compared to those with a history of
compliance."

	Test-Hyp3: Having a history of violation vs. compliance will moderate (increase) the effect of legalization of commitment on expectation of compliance.

Stated-Hyp3: "Legalizing a commitment should have a greater effect on expectations of
compliance in lower stakes issues compared to higher stakes issues concerning national
security."

	Test-Hyp4: Economic (low stakes) vs. military (high stakes) issue will moderate (increase) the effect of legalization of commitment on expectation of compliance.

	
********************************************************************************
NOTES:
- Stated hypothesis 1 does not specify a definition of level of legalization. 
There are 4 treatment condidtions: control (no commitment and no legalization); 
verbal commitment (no legalization), soft commitment (legalization), and hard 
commitment (legalization). 
We are splitting this hypothesis into two tests: 1) any legalization vs. none; 
2) hard vs. soft.

- For stated hypothesis 3, we are assuming the authoer meant the military issue 
as high stakes issue and economic issue as low-stakes.
*/

clear all
use "Wallace362.dta", clear

********************************************************************************

* INDICATORS OF EXPERIMENTAL MANIPULATIONS

* Commitment type
	tab XTESS3135
	recode XTESS3135 (1/2=0 "0 no commitment") (3/6=1 "1 hard") (7/10=2 "2 soft") (11/14=3 "3 verbal"), gen(commitment_type)
	tab commitment_type
		
	* no legalization vs. any legalization of commitment
		recode commitment_type (3=0 "verbal comitment w/o legalization") (1/2=1 "legalization") (*=.), gen(anylegalization)
		tab anylegalization
		
	* hard vs. soft law
		recode commitment_type (2=0 "soft law") (1=1 "hard law") (*=.), gen(hardlegalization)
		tab hardlegalization		
		
* compliance	
		recode XTESS3135 (1/2=0 "0 control") (3 4 7 8 11 12=2 "2 violator") (5 6 9 10 13 14=1 "1 complier"), gen(violator)
		tab violator
		
* issue	
		recode XTESS3135 (1 3 5 7 9 11 13=0 "0 military") (2 4 6 8 10 12 14=1 "1 economics"), gen(issue)
		tab issue
	
* OUTCOME MEASURES

* expectation about compliance (different treatment groups were asked slighlty differently worded questions)
	foreach var in QM1 QE1 QM2_A QM2_B QE2_A QE2_B {
		tab `var'
		replace `var'=. if `var'==-1
		tab `var', mis
	}

	* create a single credibility measure
	gen compliance_expect= QM2_A
	replace compliance_expect = QM2_B if compliance_expect==.
	replace compliance_expect = QE2_B if compliance_expect==.
 	replace compliance_expect = QE2_B if compliance_expect==.
 	replace compliance_expect = QM1 if compliance_expect==.	
 	replace compliance_expect = QE1 if compliance_expect==.	
  	
	lab def compliance_expect 1 "very likely to violate commitment" 4 "very unlikely to violate commitment"
	tab compliance_expect, mis
	


	
********************************************************************************

* ANALYSIS
	

*Test-Hyp1: Expectation for compliance will be higher in any legalization scenario vs. no legalization
	reg compliance_expect i.anylegalization
	// do not reject. 0.025
	tess 1.anylegalization +, init(Wallace362)
	
*Test-Hyp2: Expectation for compliance will be higher in hard law vs. soft law
	reg compliance_expect i.hardlegalization
	// reject. 0.540
	tess 1.hardlegalization +
	
*Test-Hyp3: Having a history of violation vs. compliance will moderate (increase) the effect of legalization of commitment on expectation of compliance.
	reg compliance_expect i.violator##i.anylegalization if violator!=0
	// reject. 0.680
	tess 1.anylegalization#2.violator +
	
*Test-Hyp4: Economic (low stakes) vs. military (high stakes) issue will moderate (increase) the effect of legalization of commitment on expectation of compliance.	
	reg compliance_expect i.issue##i.anylegalization 
	// reject. 0.240
	tess 1.anylegalization#1.issue +
